package com.syg.apiversion.autoconfig;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnProperty(
        name = {"syg.apiVersion.enabled"},
        matchIfMissing = true
)
public class ApiVersionWebMvcAutoConfig {

    private static final Logger log = LoggerFactory.getLogger(ApiVersionWebMvcAutoConfig.class);

    public ApiVersionWebMvcAutoConfig() {
    }

    @Bean
    public WebMvcRegistrations apiVersionWebMvcRegister() {
        ApiVersionWebMvcRegister apiVersionWebMvcRegister = new ApiVersionWebMvcRegister();
        log.info("^_^apiVersion组件加载成功");
        return apiVersionWebMvcRegister;
    }
}
